<template>
	<view class="userinfo">
		<view class="head">
			<view class="userinfoimg">
				<image src="../../static/ico/6f6bf0d1612dda491af.jpeg" mode=""></image>
				<text>{{username}}</text>
				<image @click="change" class="minimg" src="../../static/ico/gai.png" mode=""></image>
			</view>
			
		</view>
		<view class="userinfolist" v-for="(item,index) in list" :key="index" @click="routejump(item.path)">
			<view class="listimgtitle">
				<image :src="item.imgurl" mode=""></image>
				<text>{{ item.title }}</text>
			</view>
			<image src="../../static/ico/right.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				username: uni.getStorageSync('username') || '',
				list: [
					{
						imgurl: "../../static/ico/aboutus.png",
						title: "账号管理",
						path: "./account/account"
					},
					{
						imgurl: "../../static/ico/tu2.png",
						title: "分销中心",
						path: "./Distribution/Distribution"
					},
					{
						imgurl: "../../static/ico/tu1.png",
						title: "密码修改",
						path: "./modify/modify"
					},
					{
						imgurl: "../../static/ico/new.png",
						title: "新增位置",
						path:"./add/add"
					}
				]
			};
		},
		onLoad: function(){
			this.loadInfo();
		},
		methods:{
			loadInfo:function(){
				let username = uni.getStorageSync('username');
				console.log(username);return false;
			},
			change(){
				uni.navigateTo({
					url:"./change/change"
				})
			},
			routejump(path){
				uni.navigateTo({
					url: path
				})
			}
		}
	}
</script>

<style lang="less">
.userinfo{
	width: 100%;
	.head{
		width: 100%;
		height: 300rpx;
		background: #0180FF;
		padding: 100rpx 40rpx 0rpx 40rpx;
		box-sizing: border-box;
		.userinfoimg{
			display: flex;
			align-items: center;
			text{
				margin-left: 20rpx;
				font-size: 36rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
			}
			.minimg{
				margin-left: 20rpx;
				width: 25rpx;
				height: 25rpx;
				border-radius: 0;
			}
			image{
				width: 150rpx;
				height: 150rpx;
				border-radius: 50%;
			}
		}
		
	}
	.userinfolist{
		width: 95%;
		margin: 0 auto;
		padding: 20rpx 0;
		display: flex;
		justify-content: space-between;
		box-sizing: border-box;
		align-items: center;
		border-bottom: 1rpx solid #D1D1DA;
		.listimgtitle{
			display: flex;
			align-items: center;
			text{
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #292B32;
			}
			image{
				width: 30rpx;
				height: 26rpx;
				margin-right: 20rpx;
			}
		}
		image{
			width: 40rpx;
			height: 45rpx;
		}
	}
}
</style>
